001 /* 002 * Copyright 2005 Niclas Hedhman 003 * Copyright 2005 Stephen McConnell 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 013 * implied. 014 * 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 019 package net.dpml.transit.link; 020 021 import java.io.IOException; 022 023 import java.net.URI; 024 025 /** 026 * The LinkManager is responsible for storing the mapping between a Link 027 * instance and a URI. 028 * @author <a href="http://www.dpml.net">Digital Product Meta Library</a> 029 * @version 1.0.1 030 */ 031 public interface LinkManager 032 { 033 /** 034 * Sets the URI for the provided link URI. 035 * The LinkManager is required to persist this information between 036 * JVM restarts and should be persisted on a scope larger than a 037 * single JVM, typically a host or a local area network. LinkManagers 038 * are encouraged to establish other virtual scopes independent of 039 * network topologies. 040 * 041 * @param link the uri of the link 042 * @param target the uri of the target that the link redirects to 043 * @exception IOException if an IO error occurs 044 */ 045 void setTargetURI( URI link, URI target ) throws IOException; 046 047 /** 048 * Returns the URI that the supplied link URI is referencing. 049 * 050 * @param link the link uri 051 * @return the target uri 052 * @exception IOException if an IO error occurs 053 */ 054 URI getTargetURI( URI link ) throws IOException; 055 056 }